package com.ymatou.iapi.dguser.service;

import java.util.List;

import com.google.common.reflect.TypeToken;
import com.ymatou.iapi.dguser.parameter.DistributorDto;
import com.ymatou.iapi.dguser.parameter.UserDto;
import com.ymt.base.YmatouBaseCall;
import com.ymt.core.tool.FormatUtil;
import com.ymttest.utils.EnvSetup;
/**
*分销员查询Call
*FreeMaker Template自动生成代码
*/
public class QueryDistributorCall extends YmatouBaseCall{
	private static String opurl ="user/queryDistributor";
	
	public QueryDistributorCall() {
		super(EnvSetup.getSystemUrl("dguser_iapi"),opurl,"POST","JSON");
	}
	@Override
	public void addDefHeader() {
		client.addHeader("Accept","text/xml,text/javascript,text/html,application/json");
		client.addHeader("Content-Type", "application/json; charset=UTF-8");
	}
	public DistributorDto getDistributorDto(){
		DistributorDto userDtos=null;
		try {
			String sResults=getJsonObject().get("distributorDto").toString();
			userDtos=(DistributorDto) FormatUtil.GSONToObject(sResults, new TypeToken<DistributorDto>(){}.getType());
		}catch (Exception e) {
		}
		return userDtos;
	}
}